#include "giza.h"
static CUProgress progress;


bool func1( char giza_fn[] )
{
	CGiza giza;
	if( giza.Open( giza_fn ) == false )	return false;

	int num_sent = 0;
	int num_src =0;
	int num_align = 0;
	while(1)	{
		if( giza.ReadSent() == false )	{
			break;
		}
		num_sent++;

		num_src += giza.src.tok_list.GetSize() - 1;
		for( int i=1; i<giza.align.align_list.GetSize(); i++ )	{
			CUString str = giza.align.align_list.GetAt(i);
			CUStringList ls;
			ls.TokenizeByChar( str, " ", false );
			num_align += ls.GetSize();
		}

		/*
		giza.src.tok_list.PrintEx( stdout );
		giza.align.align_list.PrintEx( stdout );
		fflush( stdout );
		*/

	}

	fprintf( stdout, "%1.4f\t%d / %d\n", (float)num_align/(float)num_src, num_align, num_src );
	return true;	
}


int main( int argc, char *argv[] )
{
	if( argc != 2 )	{
		fprintf( stderr, "usage: %s GIZA\n", argv[0] );
		return 1;
	}


	if( func1( argv[1] )	== false )	{
		return 1;
	}

	return 0;
}

